package com.winphone.uvam.service;

import com.baomidou.mybatisplus.service.IService;
import com.winphone.uvam.entity.FileInfo;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * <p>
 * 文件表 服务类
 * </p>
 *
 * @author LiaoJunJie
 * @since 2017-12-18
 */
public interface IFileInfoService extends IService<FileInfo> {

    FileInfo getById(Long id);

    FileInfo getByMd5(String md5);

    void writeFile(String md5, OutputStream out, String fileSavePath, long skip) throws IOException;

    FileInfo saveFile(InputStream fileStream, String fileSavePath, String fileName,String prefix, String contentType, String creator);

    InputStream readFile(String md5, String fileSavePath) throws FileNotFoundException;
}
